Skip to content

Conversation

@recursiveAF
Copy link
Owner

  • fix: ensure persisted state overrides class defaults
  • Remove early return in Flow.init to allow proper state initialization
  • Add test_flow_default_override.py to verify state override behavior
  • Fix issue where default values weren't being overridden by persisted state

Fixes the issue where persisted state values weren't properly overriding class defaults when restarting a flow with a previously saved state ID.

  • test: improve state restoration verification with has_set_count flag

  • test: add has_set_count field to PoemState

  • refactoring test

  • fix: ensure persisted state overrides class defaults

  • Remove early return in Flow.init to allow proper state initialization
  • Add test_flow_default_override.py to verify state override behavior
  • Fix issue where default values weren't being overridden by persisted state

Fixes the issue where persisted state values weren't properly overriding class defaults when restarting a flow with a previously saved state ID.

  • test: improve state restoration verification with has_set_count flag

  • test: add has_set_count field to PoemState

  • refactoring test

  • Fixing flow state

  • fixing peristed stateful flows

  • linter

  • type fix


* fix: ensure persisted state overrides class defaults

- Remove early return in Flow.__init__ to allow proper state initialization
- Add test_flow_default_override.py to verify state override behavior
- Fix issue where default values weren't being overridden by persisted state

Fixes the issue where persisted state values weren't properly overriding
class defaults when restarting a flow with a previously saved state ID.

Co-Authored-By: Joe Moura <joao@crewai.com>

* test: improve state restoration verification with has_set_count flag

Co-Authored-By: Joe Moura <joao@crewai.com>

* test: add has_set_count field to PoemState

Co-Authored-By: Joe Moura <joao@crewai.com>

* refactoring test

* fix: ensure persisted state overrides class defaults

- Remove early return in Flow.__init__ to allow proper state initialization
- Add test_flow_default_override.py to verify state override behavior
- Fix issue where default values weren't being overridden by persisted state

Fixes the issue where persisted state values weren't properly overriding
class defaults when restarting a flow with a previously saved state ID.

Co-Authored-By: Joe Moura <joao@crewai.com>

* test: improve state restoration verification with has_set_count flag

Co-Authored-By: Joe Moura <joao@crewai.com>

* test: add has_set_count field to PoemState

Co-Authored-By: Joe Moura <joao@crewai.com>

* refactoring test

* Fixing flow state

* fixing peristed stateful flows

* linter

* type fix

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Joe Moura <joao@crewai.com>
# Verify state restoration and selective field override
assert flow3.state.id == original_uuid
assert flow3.state.counter == 42 # Preserved
assert flow3.state.counter == 43 # Preserved
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This assertion expects counter=43 but could be incorrect. When flow3 is created, it only overrides the message, not the counter. The counter should remain 42 from the original state since it wasn't modified.

💬 Reply with /praise to tell me that this comment was useful.

Is this comment irrelevant to your project? Reply with /ignore to no longer receive comments like this in the future.

@recurseml
Copy link

recurseml bot commented Jan 25, 2025

😱 Found 1 issue. Time to roll up your sleeves! 😱

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants